<?php

namespace app\user\controller;

use app\common\model\Blevel;
use app\common\model\UserRelation;
use think\Controller;

class Base extends Controller
{
    protected $suser = 0;

    protected function _initialize()
    {
        parent::_initialize();
        if (session('suser')) {
            $user = UserRelation::where('user_num', session('suser')->user_num)->find();
            session('suser', $user);
            $this->suser = $user;
        } else {
            $this->error(lang('Please login first'), url('index/login'));
        }
    }

}